//package com.chilly.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.CorsRegistry;
//import org.springframework.web.servlet.config.annotation.EnableWebMvc;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//
///**
// * 全局CORS配置
// * <p>
// * Created by Chilly Cui on 2020/11/18.
// */
//@Configuration
//@EnableWebMvc
//public class WebConfig extends WebMvcConfigurerAdapter {
//    @Override
//    public void addCorsMappings(CorsRegistry registry) {
//        System.out.println("cors registry------------");
//        registry.addMapping("/**");
//        registry.addMapping("/api/**")
//                .allowedOrigins("http://domain2.com","http://127.0.0.1/前端web服务器访问 ")
//                .allowedMethods("PUT", "DELETE")
//                .allowedHeaders("Access-Control-Allow-Origin:http://127.0.0.1")
//                .allowedHeaders("header1", "header2", "header3")
//                .exposedHeaders("header1", "header2")
//                .allowCredentials(false).maxAge(3600);
//    }
//}
